1 Public Class FrmPRODUCTS_REORDER
2
3 Private Sub FrmPRODUCTS_REORDER_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
4 ' MDIREFRESH()
5 MDIDISABLED()
6 End Sub
7 Private Sub FrmPRODUCTS_REORDER_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
8 Dim i As Integer
9 sqlSTR = "SELECT TBL_Category_Item_File.Item_ID as 'ID', Item_Name as 'Name', TBL_Category_Item_File.Item_Description as 'Description / Item Number', TBL_Stocks_Balances.Item_Price as 'Price', Item_Reorder_Point as 'Reorder Point', Item_QTY as 'CURRENT STOCKS' " & _
10 "FROM TBL_Category_Item_File INNER JOIN " & _
11 "TBL_Stocks_Balances ON TBL_Category_Item_File.Item_ID = TBL_Stocks_Balances.Item_ID " & _
12 "WHERE TBL_Stocks_Balances.Item_QTY <= Item_Reorder_Point"
13 FillListView(ExecuteSQLQuery(sqlSTR), lstreorder, 0)
14 For i = 0 To lstreorder.Items.Count - 1
15 If Int(lstreorder.Items(i).SubItems(5).Text) <= 0 Then
16 lstreorder.Items(i).ForeColor = Color.Brown
17 End If
18 Next
19 Audit_Trail(xUser_ID, TimeOfDay, "View Products On Reorder Point")
20 End Sub
21
22 Private Sub lstreorder_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstreorder.MouseDoubleClick
23 Dim tmpPurchaseID As Integer
24 If lstreorder.Items.Count > 0 Then
25 lstreorder.Focus()
26 lstreorder.Select()
27 sqlSTR = "SELECT *, * FROM TBL_Purchase_Detail " & _
28 "INNER JOIN TBL_Purchase_Order ON TBL_Purchase_Detail.Purchase_ID = TBL_Purchase_Order.Purchase_ID " & _
29 "WHERE TBL_Purchase_Detail.Item_ID =" & lstreorder.FocusedItem.Text & _
30 " ORDER BY TBL_Purchase_Detail.Purchase_ID DESC"
31 ExecuteSQLQuery(sqlSTR)
32 If sqlDT.Rows.Count > 0 Then
33 tmpPurchaseID = sqlDT.Rows(0)("Purchase_ID")
34 globalID2 = sqlDT.Rows(0)("Item_ID")
35 'Me.Close()
36 With FrmPURCHASEORDERADD
37 'sqlSTR = "SELECT * FROM TBL_Suppliers WHERE Supp_ID = " & sqlDT.Rows(0)("Supp_ID")
38 'ExecuteSQLQuery(sqlSTR)
39 'If sqlDT.Rows.Count > 0 Then
40 'MsgBox("here")
41 '.cmbsupplier.Text = "test"
42 'End If
43 FormShow(FrmPURCHASEORDERADD, False, tmpPurchaseID, 0)
44 End With
45 'MsgBox(sqlDT.Rows(0)("Purchase_ID"))
46 End If
47 End If
48 End Sub
49
50
51
52 Private Sub FrmPRODUCTS_REORDER_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
53 With Me
54 GroupBox1.Width = (.Width - (MDIMain.TSHoldRight.Width / 2)) + 60
55 GroupBox1.Height = .Height - (MDIMain.TSHoldAdvisory.Height + 45)
56 .lstreorder.Width = GroupBox1.Width - 10
57 .lstreorder.Height = GroupBox1.Height - 18
58 End With
59 End Sub
60
61 Private Sub lstreorder_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstreorder.SelectedIndexChanged
62
63 End Sub
64 End Class